package evolution.cli;

import java.io.File;

import evolution.VersionedDirectoryTreeBuilder;


public class WipeRepositoryCommand implements Command
{
	private final VersionedDirectoryTreeBuilder builder;

	public WipeRepositoryCommand(VersionedDirectoryTreeBuilder builder)
	{
		this.builder = builder;
	}

	public void execute(String[] args) throws Exception
	{
		if (args.length > 1)
		{
			for (int i = 1; i < args.length; i++)
			{
				builder.wipeRepository(new RootFileSystemDirectory(new File(args[i])));
			}
		}
		else
		{
			builder.wipeRepository(new RootFileSystemDirectory(new File(System.getProperty("user.dir"))));
		}
	}

}
